oracle.pg.text.lucene

## Class OracleIndexWriter

- java.lang.Object
- - org.apache.lucene.index.IndexWriter
  - - oracle.pg.text.lucene.OracleIndexWriter

- All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.lucene.index.TwoPhaseCommit

      public class OracleIndexWriter
      extends org.apache.lucene.index.IndexWriter

  This class extends Lucene IndexWriter. It has logic to control commit operations based on the number of documents indexed.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.IndexWriter

      `org.apache.lucene.index.IndexWriter.IndexReaderWarmer`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.index.IndexWriter

      `MAX_TERM_LENGTH, SOURCE, SOURCE_ADDINDEXES_READERS, SOURCE_FLUSH, SOURCE_MERGE, WRITE_LOCK_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OracleIndexWriter(org.apache.lucene.store.Directory directory, org.apache.lucene.index.IndexWriterConfig config)` Creates a new OracleIndexWriter from a given directory and configuration
    `OracleIndexWriter(org.apache.lucene.store.Directory directory, org.apache.lucene.index.IndexWriterConfig config, int commitBatchSize)` Creates a new OracleIndexWriter from a given directory and configuration

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addToIndexedDocs(long number)` Increments the number of documents indexed by this object
    `long` | `getNumberIndexedDocs()` Gets the current number of documents indexed using this object
    `boolean` | `isCommitRequired()` Verifies if a commit of the index is required as the number of documents indexed matches the commit size
    `boolean` | `isDataUncommited()` Verifies if there are documents that have not been commited
    `void` | `setIndexedDocs(long number)` Sets the number of documents indexed by this object to the given number

    - ### Methods inherited from class org.apache.lucene.index.IndexWriter

      `addDocument, addDocument, addDocuments, addDocuments, addIndexes, addIndexes, close, close, commit, deleteAll, deleteDocuments, deleteDocuments, deleteDocuments, deleteDocuments, deleteUnusedFiles, forceMerge, forceMerge, forceMergeDeletes, forceMergeDeletes, getAnalyzer, getCommitData, getConfig, getDirectory, getMergingSegments, getNextMerge, hasDeletions, hasPendingMerges, hasUncommittedChanges, isLocked, maxDoc, maybeMerge, merge, numDeletedDocs, numDocs, numRamDocs, prepareCommit, ramSizeInBytes, rollback, segString, segString, segString, setCommitData, tryDeleteDocument, unlock, updateDocument, updateDocument, updateDocuments, updateDocuments, waitForMerges`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OracleIndexWriter

          public OracleIndexWriter(org.apache.lucene.store.Directory directory,
                           org.apache.lucene.index.IndexWriterConfig config)
                            throws IOException

      Creates a new OracleIndexWriter from a given directory and configuration
      Parameters:
        `directory` - a `Directory` object where the index is stored.
        `config` - an `IndexWriterConfig` object denoting the index configuration such as buffer size, etc.
      Throws:
        `IOException`

    - #### OracleIndexWriter

          public OracleIndexWriter(org.apache.lucene.store.Directory directory,
                           org.apache.lucene.index.IndexWriterConfig config,
                           int commitBatchSize)
                            throws IOException

      Creates a new OracleIndexWriter from a given directory and configuration
      Parameters:
        `directory` - a `Directory` object where the index is stored.
        `config` - an `IndexWriterConfig` object denoting the index configuration such as buffer size, etc.
        `commitBatchSize` - a positive integer denoting the number of documents to index before forcing a commit over the Lucene index.
      Throws:
        `IOException`

  - ### Method Detail

    - #### addToIndexedDocs

          public void addToIndexedDocs(long number)

      Increments the number of documents indexed by this object
      Parameters:
        `number` - a positive integer with the number of documents indexed

    - #### getNumberIndexedDocs

          public long getNumberIndexedDocs()

      Gets the current number of documents indexed using this object

    - #### isCommitRequired

          public boolean isCommitRequired()

      Verifies if a commit of the index is required as the number of documents indexed matches the commit size

    - #### isDataUncommited

          public boolean isDataUncommited()

      Verifies if there are documents that have not been commited

    - #### setIndexedDocs

          public void setIndexedDocs(long number)

      Sets the number of documents indexed by this object to the given number
      Parameters:
        `number` - a positive integer with the number of documents indexed

Copyright © 2015 Oracle and/or its affiliates. All Rights Reserved.